package com.ruoyi.system.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.system.mapper.ErpPostMapper;
import com.ruoyi.system.domain.ErpPost;
import com.ruoyi.system.service.IErpPostService;

/**
 * 岗位Service业务层处理
 *
 * @author ruoyi
 * @date 2025-04-07
 */
@Service
public class ErpPostServiceImpl implements IErpPostService
{
    @Autowired
    private ErpPostMapper erpPostMapper;

    /**
     * 查询岗位
     *
     * @param id 岗位主键
     * @return 岗位
     */
    @Override
    public ErpPost selectErpPostById(Long id)
    {
        return erpPostMapper.selectErpPostById(id);
    }

    /**
     * 查询岗位列表
     *
     * @param erpPost 岗位
     * @return 岗位
     */
    @Override
    public List<ErpPost> selectErpPostList(ErpPost erpPost)
    {
        return erpPostMapper.selectErpPostList(erpPost);
    }

    /**
     * 新增岗位
     *
     * @param erpPost 岗位
     * @return 结果
     */
    @Override
    public int insertErpPost(ErpPost erpPost)
    {
        erpPost.setCreateTime(DateUtils.getNowDate());
        return erpPostMapper.insertErpPost(erpPost);
    }

    /**
     * 修改岗位
     *
     * @param erpPost 岗位
     * @return 结果
     */
    @Override
    public int updateErpPost(ErpPost erpPost)
    {
        erpPost.setUpdateTime(DateUtils.getNowDate());
        return erpPostMapper.updateErpPost(erpPost);
    }

    /**
     * 批量删除岗位
     *
     * @param ids 需要删除的岗位主键
     * @return 结果
     */
    @Override
    public int deleteErpPostByIds(Long[] ids)
    {
        return erpPostMapper.deleteErpPostByIds(ids);
    }

    /**
     * 删除岗位信息
     *
     * @param id 岗位主键
     * @return 结果
     */
    @Override
    public int deleteErpPostById(Long id)
    {
        return erpPostMapper.deleteErpPostById(id);
    }
}
